arr = input().split(" ")
for i in range(len(arr)):
    arr[i] = int(arr[i])
minNum = min(arr)
for i in range(minNum, 0, -1):
    count = 0
    for num in arr:
        if num % i == 0:
            count += 1
    if count == len(arr):
        print(i)
        break
